Handling overlapping visual objects is an ongoing problem in rendering graphics. Overlapping visual objects can bloat file sizes and lengthen rendering times. There are existing optimization functions that can be used on groups of non-overlapping objects to minimize file size and rendering time. In view of this, it would be advantageous to provide a function that groups the visual objects, while retaining correct z-order, into sets of non-overlapping objects so that file size and rendering time optimizations man be used.